package com.sls.game.dao.enfu.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sls.game.dao.enfu.EnfuChargeTypeDAO;
import com.sls.game.dao.impl.SuperDAO;
import com.sls.game.pojo.enfu.EnfuChargeTypeInfo;

/**
 * 
 * @description 恩付商品充值方式--DAO
 * @author Wangxuegang
 * @date 2013-4-28
 */
@Repository("enfuChargeTypeDAO")
public class EnfuChargeTypeDAOImpl extends SuperDAO<EnfuChargeTypeInfo>
		implements EnfuChargeTypeDAO {

	/**
	 * 数据插入
	 * 
	 * @param enfuChargeTypeInfo
	 */
	@Override
	public void insert(EnfuChargeTypeInfo enfuChargeTypeInfo) {
		this.getSqlSession().insert("mybatis.xml.EnfuChargeTypeMapper.insert",
				enfuChargeTypeInfo);
	}

	/**
	 * 记录查询
	 * 
	 * @param enfuChargeTypeInfo
	 * @return
	 */
	@Override
	public String queryChargeType(EnfuChargeTypeInfo enfuChargeTypeInfo) {
		String hidChargeType = null;
		hidChargeType = this.getSqlSession().selectOne(
				"mybatis.xml.EnfuChargeTypeMapper.queryChargeType",
				enfuChargeTypeInfo);

		return hidChargeType;
	}

	/**
	 * 通过goodsId,chargetypeName,buynumber_list查询一条记录
	 * 
	 * @param enfuChargeTypeInfo
	 * @return
	 */
	@Override
	public List<EnfuChargeTypeInfo> queryOneOrMoreChargeType(
			EnfuChargeTypeInfo enfuChargeTypeInfo) {
		List<EnfuChargeTypeInfo> list = null;
		list = this.getSqlSession().selectList(
				"mybatis.xml.EnfuChargeTypeMapper.queryOneOrMoreChargeType",
				enfuChargeTypeInfo);
		return list;
	}

	/**
	 * 根据商品编号，删除该商品记录
	 * 
	 * @param goodsId
	 */
	@Override
	public void deleteById(String id) {
		this.getSqlSession().delete(
				"mybatis.xml.EnfuChargeTypeMapper.deleteById", id);
	}

}
